define(['jquery','jquery.qrcode'],function($){
	$(function(){
		$('#generate').bind('click',function(){
			var data = $('#inputText').val();
			var file = $('#imgUpload').get(0).files[0];
			var logoImage = null;
			if(file!=undefined){
				logoImage = new Image();
				var fr = new FileReader();
				fr.onload=function(){
					var imageData = fr.result;
					logoImage.src=imageData;
				};
				fr.readAsDataURL(file);
			}
			
			$('#viewDiv').empty();
			$('#viewDiv').qrcode({width:140,height:140,correctLevel:0,text:data,quiet:20,logoImage:logoImage}); 
		});
	});
});